package com.edu.modules.baseinfo.api;

import com.alibaba.fastjson.JSONObject;
import com.edu.modules.baseinfo.model.LoginModel;
import com.edu.modules.baseinfo.model.RegisterModel;
import com.edu.modules.baseinfo.model.SignUpModel;
import com.edu.modules.baseinfo.service.AccountService;
import com.edu.modules.baseinfo.service.SignUpService;
import com.edu.modules.baseinfo.vo.LoginResultVo;
import com.edu.modules.baseinfo.vo.ResultVo;
import com.sari.common.utils.CaptchaGenerator;
import com.sari.common.utils.RequestContextUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import javax.imageio.ImageIO;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.awt.image.BufferedImage;
import java.io.IOException;
import java.util.Map;

/**
 *
 * @author kwj
 * @version 2016-08-01
 */
@CrossOrigin
@Controller
@RequestMapping(value = "signUp")
public class SignUpApi {

    @Autowired
    private SignUpService signUpService;

    @ResponseBody
    @RequestMapping(value = "/add",method = RequestMethod.POST)
    public ResultVo signUp(HttpServletRequest request){

        JSONObject param = RequestContextUtils.readJson(request);

        return signUpService.signUp(param);

    }

    @ResponseBody
    @RequestMapping(value = "/list")
    public JSONObject getSignUpList(HttpServletRequest request){

        JSONObject param = RequestContextUtils.readJson(request);

        return signUpService.getSignUpList(param);

    }

    @ResponseBody
    @RequestMapping(value = "/pay")
    public  ResultVo updatePaidStatus(String id,String isPaid){

        return signUpService.updatePaidStatus(id,isPaid);
    }
}
